<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>睿立南方教育管理平台</title>
<link href="/ipodium-res/styles/web.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.errorMessage li{
	list-style: none;
}
.errorMessage span{
	color: red;
}

</style>
<script type="text/javascript" src="/ipodium-res/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/ipodium-res/js/ajaxupload.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	new AjaxUpload('uploadButton', {
	    action: '/ipodium/uploadAvatar',
	    name: "userFile",
		onSubmit : function(file , ext){
	        // Allow only images. You should add security check on the server-side.
			if (ext && /^(jpg|png|jpeg|gif)$/.test(ext.toLowerCase())){
				/* Setting data */
				this.setData({
					'ext': ext,
					'type':'ipodiumAvatar'
				});					
				this.disable();	
			} else {					
				// extension is not allowed
				$('#msg').text('错误：只允许上传图片文件。');
				// cancel upload
				return false;				
			}
		},
		onComplete : function(file){
			$('#msg').text('上传文件成功：'+file);
			this.enable();
			//refresh();
		}		
	});
});

function refresh(){
	window.location.reload(true);
}

</script>

</head>

<body>
<div class="Rightframe">
<div class="title">首页 > 视频中心 > 修改资料</div>
<div class="modified">
<div class="mtx"><img src="<s:property value="avatar"/>"width="100" height="100"></div>
<div class="mzi">
<div class="gh">
<span class="text">更换头像</span>
<p>推荐使用100*100像素的头像，显示效果更佳！</p>
<p id="msg" style="color:red"></p>
</div>
<div class="jiatu">
<dl><a href="#"><img src="/ipodium-res/images/jiatu.gif" id="uploadButton" style="cursor:pointer" width="22" height="24"></a></dl>
<ol>点击此处选择上传头像（最大支持100KB）<span id="msg"></span></ol>
</div>
</div>
</div>
<s:form  namespace="/ipodium" action="editProfile">
<div class="modlist">
<dl><s:radio list="genderTypes"  listKey="name" listValue="value" name="genderType"></s:radio></dl>
<ol><input  type="submit" class="btn" value="修改密码" /></ol>
</div>
<div class="modlist"><s:textfield name="emailAddr" cssClass="put3" />
<s:if test="fieldErrors.emailAddr.size>0"><s:fielderror fieldName="emailAddr" /></s:if>
<s:else><span class="text">*填写电子邮箱，方便给您提供最新优惠信息</span></s:else>
</div>
<div class="modlist"><s:textfield name="mobileNo" cssClass="put3" />
<s:if test="fieldErrors.mobileNo.size>0"><s:fielderror fieldName="mobileNo" /></s:if>
<s:else><span class="text">*请输入您常用的手机号码</span></s:else>
</div>
<div class="modlist"><s:textfield name="contactAddr" cssClass="put3" />
<span class="text">请输入您常用的联系地址</span></div>
<div class="modlist"><s:textfield name="qqNo" cssClass="put3" />
<span class="text">常用QQ</span></div>
<div class="bottom2"><input  type="submit" class="btn" value="确定" /></div>
</div>
</s:form>
</body>
</html>
